---
title: "SQL-004: Retrieve attorney list with names"
summary: Retrieve attorney profiles joined to employee records to build the attorney selection list.
status: draft
owner: SAIF Documentation Pipeline
last_reviewed: 2026-08-21
library: SAIF.Application.Claim.Legal
reference_type: embedded
---

# SQL-004 Retrieve attorney list with names

Retrieves `ATTORNEY_PROFILE` rows joined to `ADP_EMPLOYEE` to resolve attorney display names, for the `ATTORNEYLISTSQL` code-table lookup used by the attorney-assignment maintenance UI.

## Classification

| Field | Value |
| --- | --- |
| **SQL ID** | SQL-004 |
| **Operation type** | Read |
| **Execution method** | Inline SQL (`clsCodeCollection.GetCodeCollection`) |
| **Database** | Oracle |
| **Command type** | Text |
| **Business object** | N/A (Application layer) |
| **Criteria property** | N/A (Application layer) |
| **Lifecycle method** | N/A (Application layer) |
| **Application class** | `clsAttorneyTableManager` |

## Parameters

No runtime parameters — this is a static code-table lookup constant (`ATTORNEYLISTSQL`), executed as-is via `clsCodeCollection.GetCodeCollection(DPI, ATTORNEYLISTSQL)`.

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| [ADP_EMPLOYEE](../database-tables.md#adp_employee) | SELECT, JOIN | `EMPLID`, `LAST_NAME`, `FIRST_NAME`, `PREFERRED_NAME` |
| [ATTORNEY_PROFILE](../database-tables.md#attorney_profile) | SELECT, JOIN | `PROFILE_EMPLID` |

## Sample SQL

```sql
SELECT
  PROFILE_EMPLID As code,
  LAST_NAME || ', ' || decode(nvl(preferred_name, ' '), ' ', FIRST_NAME, preferred_name) AS code_descr
FROM ADP_EMPLOYEE A, ATTORNEY_PROFILE P
WHERE A.EMPLID = P.PROFILE_EMPLID
```

## Sources
- `SAIF.Application.Claim.Legal\clsAttorneyTableManager.vb`
